<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Delfile extends MY_Controller {	
	public function __construct(){
		$this->data["menu"] = "index";
		parent::__construct();
	}
	
	public function index(){
		if(!empty($_POST)){
			@$file = $_POST["file"];
			@unlink($file);
			if(isset($_POST["table"])){
				$dir = realpath(dirname(__FILE__));				
				$table = $_POST["table"];
				$column_id = $_POST["column_id"];
				$id = $_POST["id"];
				$column = $_POST["column"];
				$data[$column] = '';				
				$this->db->update($table, $data, array($column_id => $id));
			}
		}
	}
}